x86/32on64: fix physical address restriction
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 12 Jun 2008 15:05:35 +0000 (16:05 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 12 Jun 2008 15:05:35 +0000 (16:05 +0100)
commitaa6bc4f3e99e9b04bfe100f69be1c3d7399ea36e
tree078def16f4d3b66ca1e834c8102f538ac845a646
parentcad1e62bf1cdbf8ad20689cbb000dd59b9ff1dc7
x86/32on64: fix physical address restriction

The allocation bit size setting wasn't working anymore after the
recent fix to properly use PAGE_SHIFT instead of PAGE_SIZE. This was
because the bit size implies a power-of-two range that's accessible,
but if all memory is accessible anyway (and its upper boundary is not
a power of two), the domain would either be needlessly restricted or
wouldn't be able to allocate as much memory as was intended for it
(specifically the case for Dom0 without dom0_mem= boot
parameter). Consequently, don't restrict the bit width if all memory
can be accessed.

To avoid needing to adjust this code in two places in the future (it
may need further touching when memory hotplug gets supported), fold
the logic into a function.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/x86/domain.c
xen/arch/x86/domain_build.c
xen/arch/x86/x86_64/mm.c
xen/include/asm-x86/mm.h